package com.samuel.dependencyInjection;


/**
 * @date:2017/11/21
 * @time: 14:34
 * @author:zhaoyang
 * @desc:注入
 **/

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UseHelloWorldBean {


    /**
     * @Author: taozhaoyang
     * @Description:   @Autowired 是把 HelloWorldBean 的实体Bean 注入到 UseHelloWorldBean中，让 UseHelloWorldBean准备HelloWorldBean的功能
     * @Date:  2017/11/21 14:37
     */

    @Autowired
    HelloWorldBean helloWorldBean;

    public String sayHello(String world){
        return helloWorldBean.sayHello(world);
    }

}
